#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	char c[100];
	gets(c);
	int len = strlen(c);
	int left = 0, right = 0;
	for (int i = 0; i < len; i++)
	{
		if (c[i] != ' ')
		{
			left = i;
			break;
		}
	}
	for (int j = len - 1; j >= 0; j--)
	{
		if (c[j] != ' ')
		{
			right = j;
			break;
		}
	}
	for (int i = 0; i < left; i++) printf("%c", c[i]);
	while (left <= right)
	{
		if (c[left] != ' ') printf("%c", c[left]);
		left++;
	}
	for (int j = right + 1; j < len; j++) printf("%c", c[j]);
	return 0;
}